package com.wabbei.friendcenter.action;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.webbei.friendcenter.service.MyFriendCenter;
import com.webbei.pojo.CommentCustomShow;
import com.webbei.pojo.Commission;
import com.webbei.pojo.Customs;
import com.webbei.pojo.Display;
import com.webbei.pojo.Messages;
import com.webbei.pojo.Userhot;

public class getMyFriendsTrendsAction extends ActionSupport{
	/*	
	this action is be replace
	private MyFriendCenter friservice;
	private List<Display> list;
	private List<Display> listShare;
	private List<Messages> messages;
	private int messageCount;
	private Set<String> fromNames;
	//private List<Customs> custom;//my cost money message----my money part
	private int friendCount;
	private int ownFriendAllCount;
	private Userhot userhot;
	//private double allcostmoney;
	private List<CommentCustomShow> commentcust; 
	//private List<Commission> commission;
	
	
	public List<Commission> getCommission() {
		return commission;
	}
	public void setCommission(List<Commission> commission) {
		this.commission = commission;
	}
	public List<CommentCustomShow> getCommentcust() {
		return commentcust;
	}
	public void setCommentcust(List<CommentCustomShow> commentcust) {
		this.commentcust = commentcust;
	}
	public double getAllcostmoney() {
		return allcostmoney;
	}
	public void setAllcostmoney(double allcostmoney) {
		this.allcostmoney = allcostmoney;
	}
	public List<Customs> getCustom() {
		return custom;
	}
	public void setCustom(List<Customs> custom) {
		this.custom = custom;
	}
	public Set<String> getFromNames() {
		return fromNames;
	}
	public void setFromNames(Set<String> fromNames) {
		this.fromNames = fromNames;
	}
	public int getMessageCount() {
		return messageCount;
	}
	public void setMessageCount(int messageCount) {
		this.messageCount = messageCount;
	}
	public List<Messages> getMessages() {
		return messages;
	}
	public void setMessages(List<Messages> messages) {
		this.messages = messages;
	}
	public List<Display> getListShare() {
		return listShare;
	}

	public void setListShare(List<Display> listShare) {
		this.listShare = listShare;
	}

	
	
	public Userhot getUserhot() {
		return userhot;
	}
	public void setUserhot(Userhot userhot) {
		this.userhot = userhot;
	}
	public int getOwnFriendAllCount() {
		return ownFriendAllCount;
	}
	public void setOwnFriendAllCount(int ownFriendAllCount) {
		this.ownFriendAllCount = ownFriendAllCount;
	}
	public int getFriendCount() {
		return friendCount;
	}
	public void setFriendCount(int friendCount) {
		this.friendCount = friendCount;
	}
	public List<Display> getList() {
		return list;
	}
	public void setList(List<Display> list) {
		this.list = list;
	}
	public MyFriendCenter getFriservice() {
		return friservice;
	}
	public void setFriservice(MyFriendCenter friservice) {
		this.friservice = friservice;
	}
	
	public String execute(){
		//ActionContext.getContext().getSession().get("");
		String sessionName=(String)ServletActionContext.getContext().getSession().get("username");
		list=friservice.getAllFriendsChangeByOwnName(sessionName);
		listShare=friservice.getAllFriendsChangeShareByOwnName(sessionName);
		ownFriendAllCount=friservice.getMyFriendsCount(sessionName);
		userhot=friservice.getUserhotByUserName(sessionName);
		friendCount=list.size()+listShare.size();
		messages=friservice.getALLMessagesByUserName(sessionName);
		fromNames=new HashSet<String>();
		for(Messages mes:messages){
			fromNames.add(mes.getFromName());
		}
		messageCount=fromNames.size();
		
		//custom=friservice.getCostMoneyMessageByUserName("chenhao");
		allcostmoney=0;
		for(Customs s:custom){
			allcostmoney=allcostmoney+s.getCustomPrice();
		}
		//System.out.println("allcostmoney"+allcostmoney);
		
		commentcust=friservice.getCommentCustomShow(sessionName);
		friendCount+=commentcust.size();
		//System.out.println(commentcust.toString());
		//commission=friservice.getAllCommissionByUserName(sessionName);
		double allCommissionMoney=0.0;
		for(Commission mission:commission){
			allCommissionMoney=allCommissionMoney+mission.getGetMoney();
		}
		//ServletActionContext.getRequest().setAttribute("allCommissionMoney",allCommissionMoney);
		//System.out.println(commission.toString());
		return SUCCESS;
	}
	*/
	
}
